import 'package:base_lib/app.dart';
import 'package:base_lib/index.dart';
import 'package:base_lib/utils/index.dart';
import 'package:doctor_login_lib/component.dart';
import 'package:doctor_order_lib/component.dart';
import 'package:flutter/cupertino.dart';

class DoctorOrderLib {
  static init() {
    App.httpProxy = '10.0.0.34:8888';
    App.initializer(
        [DoctorLoginComponent(), DoctorOrderComponent()],
        DoctorLoginComponent.loginPage,
        DoctorOrderComponent.prescriptionOrderPage);
  }

  static initWithContext(BuildContext context) {
    ScreenAdapter.getInstance().init(context);
  }

  static jump2PrescriptionOrderPage(BuildContext context) {
    Routers.navigateTo(context, DoctorOrderComponent.prescriptionOrderPage);
  }

  static void jump2LoginPage(BuildContext context) {
    Routers.navigateTo(context, DoctorLoginComponent.loginPage);
  }
}

class TipWrap extends StatelessWidget {
  final Widget child;

  TipWrap(this.child);

  @override
  Widget build(BuildContext context) {
    return OverlaySupport(child: child);
  }
}
